<!--
  @author duanzuocai
  @since 2018/10/30 13:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>区域列表</title>
</head>
<body>

<div class="layui-fluid">

    <!--面包屑-->
    <blockquote class="layui-crumb">
        城市区域>
        <a lay-href="/area/list.action" lay-text="区域管理" th:text="区域管理">区域管理</a>
        <zmn th:each="baseArea, baseAreaState : ${baseAreas}">
            <zmn th:if="${baseAreaState.last}" th:text="${'>'+baseArea.name}"></zmn>
            <a th:if="${!baseAreaState.last}" th:href="${'/area/list.action?parentId='+baseArea.areaId}" >>[[${baseArea.name}]]</a>
        </zmn>
    </blockquote>

    <div class="layui-card">

        <div class="layui-split">&nbsp;</div>

        <form method="post" class="layui-form"  action="/area/list.action" lay-filter="zmn-area-filter"  id="queryForm">
            <input type="hidden" name="parentId" th:value="${vo.parentId==null?1:vo.parentId}" id="parentId">
            <div class="layui-form" th:include="area/_query :: query "></div>
        </form>

        <div class="layui-card-body">
            <div th:replace="area/_table::table"/>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm" th:if="${#authPermit.checkPermit('/area/updateStatus.action')}" lay-event="start">启用</button>
                        <button class="layui-btn layui-btn-sm layui-btn-danger" th:if="${#authPermit.checkPermit('/area/updateStatus.action')}" lay-event="stop">停用</a></button>
                    </div>
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm layui-btn-primary editArea" th:if="${#authPermit.checkPermit('/area/detail.action')}" th:attr="parentId=${vo.parentId}">
                            <i class="layui-icon"></i>
                           添加区域
                        </button>
                        <button class="layui-btn layui-btn-sm layui-btn-primary" th:if="${vo.parentId>1}"  onclick="layui.admin.events.closeThisTabs();">
                            返回上级区域
                        </button>
                    </div>
                </div>

            </script>
        </div>

    </div>
</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        hasView: [[${#authPermit.checkPermit('/area/list.action')}]],
        hasEdit: [[${#authPermit.checkPermit('/area/detail.action')}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        items: [[${items}]],
        parentId: [[${parent.areaId}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_area_list: "area/zmn.art.area.list",
    }).use(['index', 'art_area_list']);

</script>
</body>
</html>